//
//  CompanyDetailModel.m
//  u76ho
//
//  Created by m-air-01 on 16/1/30.
//  Copyright © 2016年 LV. All rights reserved.
//

#import "CompanyDetailModel.h"

@implementation CompanyDetailModel
-(instancetype)initDic:(NSDictionary *)dic
{
    self = [super init];
    if (self) {
        [self setValuesForKeysWithDictionary:dic];
    }
    return self;
}

-(void)setValue:(id)value forKey:(NSString *)key
{
    if (value) {
        if ([key isEqualToString:@"a"]) {
            NSArray * arr = value;
            NSDictionary * dic = arr.firstObject;
            CompanyDetailBaseinfoModel * model = [[CompanyDetailBaseinfoModel alloc]initDic:dic];
            _baseinfomodel = model;
        }
        else if ([key isEqualToString:@"b"])
        {
            NSArray * arr = value;
            NSMutableArray * mArr = [[NSMutableArray alloc]init];
            for (int i = 0; i<arr.count; i++) {
                NSDictionary * dic = arr[i];
                CompanyDetailRenqiModel * model = [[CompanyDetailRenqiModel alloc]initDic:dic];
                [mArr addObject:model];
            }
            _renqiArray = mArr;
        }
        else if ([key isEqualToString:@"c"])
        {
            NSArray * arr = value;
            NSMutableArray * mArr = [[NSMutableArray alloc]init];
            for (int i = 0; i<arr.count; i++) {
                NSDictionary * dic = arr[i];
                CompanyDetailWaterPullModel * model = [[CompanyDetailWaterPullModel alloc]initDic:dic];
                [mArr addObject:model];
            }
            _waterPullArray = mArr;
        }
        else if ([key isEqualToString:@"d"])
        {
            NSArray * arr = value;
            NSMutableArray * mArr = [[NSMutableArray alloc]init];
            for (int i = 0; i<arr.count; i++) {
                NSDictionary * dic = arr[i];
                CompanyDetailZPModel * model = [[CompanyDetailZPModel alloc]initDic:dic];
                [mArr addObject:model];
            }
            _zpArray = mArr;
        }
    }
    
}

-(void)setValue:(id)value forUndefinedKey:(NSString *)key
{
    NSLog(@"key = %@",key);
}

@end

//*********************************************
@implementation CompanyDetailBaseinfoModel

-(instancetype)initDic:(NSDictionary *)dic
{
    self = [super init];
    if (self) {
        [self setValuesForKeysWithDictionary:dic];
    }
    return self;
}

-(void)setValue:(id)value forKey:(NSString *)key
{
    if (value) {
        [super setValue:value forKey:key];
    }
}

-(void)setValue:(id)value forUndefinedKey:(NSString *)key
{
    NSLog(@"key = %@",key);
}

@end

//*********************************************
@implementation CompanyDetailRenqiModel

-(instancetype)initDic:(NSDictionary *)dic
{
    self = [super init];
    if (self) {
        [self setValuesForKeysWithDictionary:dic];
    }
    return self;
}

-(void)setValue:(id)value forKey:(NSString *)key
{
    if (value) {
        [super setValue:value forKey:key];
    }
}

-(void)setValue:(id)value forUndefinedKey:(NSString *)key
{
    NSLog(@"key = %@",key);
}

@end

//*********************************************
@implementation CompanyDetailWaterPullModel

-(instancetype)initDic:(NSDictionary *)dic
{
    self = [super init];
    if (self) {
        [self setValuesForKeysWithDictionary:dic];
    }
    return self;
}

-(void)setValue:(id)value forKey:(NSString *)key
{
    if (value) {
        [super setValue:value forKey:key];
    }
}

-(void)setValue:(id)value forUndefinedKey:(NSString *)key
{
    NSLog(@"key = %@",key);
}

@end

//*********************************************
@implementation CompanyDetailZPModel

-(instancetype)initDic:(NSDictionary *)dic
{
    self = [super init];
    if (self) {
        [self setValuesForKeysWithDictionary:dic];
    }
    return self;
}

-(void)setValue:(id)value forKey:(NSString *)key
{
    if (value) {
        [super setValue:value forKey:key];
    }
}

-(void)setValue:(id)value forUndefinedKey:(NSString *)key
{
    NSLog(@"key = %@",key);
}


@end
